Optimal. Leaf size=211 \[ \frac{d \left (c^2-6 c d-10 d^2\right ) \tan (e+f x)}{3 a^2 f (c-d)^3 (c+d) (c+d \sec (e+f x))}+\frac{2 d^2 (3 c+2 d) \tanh ^{-1}\left (\frac{\sqrt{c-d} \tan \left (\frac{1}{2} (e+f x)\right )}{\sqrt{c+d}}\right )}{a^2 f (c-d)^{7/2} (c+d)^{3/2}}+\frac{(c-6 d) \tan (e+f x)}{3 a^2 f (c-d)^2 (\sec (e+f x)+1) (c+d \sec (e+f x))}+\frac{\tan (e+f x)}{3 f (c-d) (a \sec (e+f x)+a)^2 (c+d \sec (e+f x))} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.373458, antiderivative size = 260, normalized size of antiderivative = 1.23, number of steps used = 7, number of rules used = 6, integrand size = 31, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.194, Rules used = {3987, 103, 152, 12, 93, 205} \[ \frac{\left (c^2-6 c d-10 d^2\right ) \tan (e+f x)}{3 f (c-d)^3 (c+d) \left (a^2 \sec (e+f x)+a^2\right )}-\frac{d \tan (e+f x)}{f \left (c^2-d^2\right ) (a \sec (e+f x)+a)^2 (c+d \sec (e+f x))}-\frac{2 d^2 (3 c+2 d) \tan (e+f x) \tan ^{-1}\left (\frac{\sqrt{c+d} \sqrt{a \sec (e+f x)+a}}{\sqrt{c-d} \sqrt{a-a \sec (e+f x)}}\right )}{a f (c-d)^{7/2} (c+d)^{3/2} \sqrt{a-a \sec (e+f x)} \sqrt{a \sec (e+f x)+a}}+\frac{(c+4 d) \tan (e+f x)}{3 f (c-d)^2 (c+d) (a \sec (e+f x)+a)^2} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3987
Rule 103
Rule 152
Rule 12
Rule 93
Rule 205
Rubi steps
\begin{align*} \int \frac{\sec (e+f x)}{(a+a \sec (e+f x))^2 (c+d \sec (e+f x))^2} \, dx &=-\frac{\left (a^2 \tan (e+f x)\right ) \operatorname{Subst}\left (\int \frac{1}{\sqrt{a-a x} (a+a x)^{5/2} (c+d x)^2} \, dx,x,\sec (e+f x)\right )}{f \sqrt{a-a \sec (e+f x)} \sqrt{a+a \sec (e+f x)}}\\ &=-\frac{d \tan (e+f x)}{\left (c^2-d^2\right ) f (a+a \sec (e+f x))^2 (c+d \sec (e+f x))}-\frac{\tan (e+f x) \operatorname{Subst}\left (\int \frac{a^2 (c+2 d)-2 a^2 d x}{\sqrt{a-a x} (a+a x)^{5/2} (c+d x)} \, dx,x,\sec (e+f x)\right )}{\left (c^2-d^2\right ) f \sqrt{a-a \sec (e+f x)} \sqrt{a+a \sec (e+f x)}}\\ &=\frac{(c+4 d) \tan (e+f x)}{3 (c-d)^2 (c+d) f (a+a \sec (e+f x))^2}-\frac{d \tan (e+f x)}{\left (c^2-d^2\right ) f (a+a \sec (e+f x))^2 (c+d \sec (e+f x))}+\frac{\tan (e+f x) \operatorname{Subst}\left (\int \frac{-a^4 (c-6 d) (c+d)-a^4 d (c+4 d) x}{\sqrt{a-a x} (a+a x)^{3/2} (c+d x)} \, dx,x,\sec (e+f x)\right )}{3 a^3 (c-d) \left (c^2-d^2\right ) f \sqrt{a-a \sec (e+f x)} \sqrt{a+a \sec (e+f x)}}\\ &=\frac{(c+4 d) \tan (e+f x)}{3 (c-d)^2 (c+d) f (a+a \sec (e+f x))^2}+\frac{\left (c^2-6 c d-10 d^2\right ) \tan (e+f x)}{3 (c-d)^3 (c+d) f \left (a^2+a^2 \sec (e+f x)\right )}-\frac{d \tan (e+f x)}{\left (c^2-d^2\right ) f (a+a \sec (e+f x))^2 (c+d \sec (e+f x))}-\frac{\tan (e+f x) \operatorname{Subst}\left (\int \frac{3 a^6 d^2 (3 c+2 d)}{\sqrt{a-a x} \sqrt{a+a x} (c+d x)} \, dx,x,\sec (e+f x)\right )}{3 a^6 (c-d)^2 \left (c^2-d^2\right ) f \sqrt{a-a \sec (e+f x)} \sqrt{a+a \sec (e+f x)}}\\ &=\frac{(c+4 d) \tan (e+f x)}{3 (c-d)^2 (c+d) f (a+a \sec (e+f x))^2}+\frac{\left (c^2-6 c d-10 d^2\right ) \tan (e+f x)}{3 (c-d)^3 (c+d) f \left (a^2+a^2 \sec (e+f x)\right )}-\frac{d \tan (e+f x)}{\left (c^2-d^2\right ) f (a+a \sec (e+f x))^2 (c+d \sec (e+f x))}-\frac{\left (d^2 (3 c+2 d) \tan (e+f x)\right ) \operatorname{Subst}\left (\int \frac{1}{\sqrt{a-a x} \sqrt{a+a x} (c+d x)} \, dx,x,\sec (e+f x)\right )}{(c-d)^2 \left (c^2-d^2\right ) f \sqrt{a-a \sec (e+f x)} \sqrt{a+a \sec (e+f x)}}\\ &=\frac{(c+4 d) \tan (e+f x)}{3 (c-d)^2 (c+d) f (a+a \sec (e+f x))^2}+\frac{\left (c^2-6 c d-10 d^2\right ) \tan (e+f x)}{3 (c-d)^3 (c+d) f \left (a^2+a^2 \sec (e+f x)\right )}-\frac{d \tan (e+f x)}{\left (c^2-d^2\right ) f (a+a \sec (e+f x))^2 (c+d \sec (e+f x))}-\frac{\left (2 d^2 (3 c+2 d) \tan (e+f x)\right ) \operatorname{Subst}\left (\int \frac{1}{a c-a d-(-a c-a d) x^2} \, dx,x,\frac{\sqrt{a+a \sec (e+f x)}}{\sqrt{a-a \sec (e+f x)}}\right )}{(c-d)^2 \left (c^2-d^2\right ) f \sqrt{a-a \sec (e+f x)} \sqrt{a+a \sec (e+f x)}}\\ &=\frac{(c+4 d) \tan (e+f x)}{3 (c-d)^2 (c+d) f (a+a \sec (e+f x))^2}-\frac{2 d^2 (3 c+2 d) \tan ^{-1}\left (\frac{\sqrt{c+d} \sqrt{a+a \sec (e+f x)}}{\sqrt{c-d} \sqrt{a-a \sec (e+f x)}}\right ) \tan (e+f x)}{a (c-d)^{7/2} (c+d)^{3/2} f \sqrt{a-a \sec (e+f x)} \sqrt{a+a \sec (e+f x)}}+\frac{\left (c^2-6 c d-10 d^2\right ) \tan (e+f x)}{3 (c-d)^3 (c+d) f \left (a^2+a^2 \sec (e+f x)\right )}-\frac{d \tan (e+f x)}{\left (c^2-d^2\right ) f (a+a \sec (e+f x))^2 (c+d \sec (e+f x))}\\ \end{align*}
Mathematica [C] time = 3.91091, size = 376, normalized size = 1.78 \[ \frac{2 \cos \left (\frac{1}{2} (e+f x)\right ) \sec ^4(e+f x) (c \cos (e+f x)+d) \left (\frac{12 d^2 (3 c+2 d) (\sin (e)+i \cos (e)) \cos ^3\left (\frac{1}{2} (e+f x)\right ) (c \cos (e+f x)+d) \tan ^{-1}\left (\frac{(\sin (e)+i \cos (e)) \left (\tan \left (\frac{f x}{2}\right ) (c \cos (e)-d)+c \sin (e)\right )}{\sqrt{c^2-d^2} \sqrt{(\cos (e)-i \sin (e))^2}}\right )}{(c+d) \sqrt{c^2-d^2} \sqrt{(\cos (e)-i \sin (e))^2}}+\frac{6 d^3 \cos ^3\left (\frac{1}{2} (e+f x)\right ) (c \sin (f x)-d \sin (e))}{c (c+d) \left (\cos \left (\frac{e}{2}\right )-\sin \left (\frac{e}{2}\right )\right ) \left (\sin \left (\frac{e}{2}\right )+\cos \left (\frac{e}{2}\right )\right )}+(c-d) \tan \left (\frac{e}{2}\right ) \cos \left (\frac{1}{2} (e+f x)\right ) (c \cos (e+f x)+d)-4 (c-4 d) \sec \left (\frac{e}{2}\right ) \sin \left (\frac{f x}{2}\right ) \cos ^2\left (\frac{1}{2} (e+f x)\right ) (c \cos (e+f x)+d)+(c-d) \sec \left (\frac{e}{2}\right ) \sin \left (\frac{f x}{2}\right ) (c \cos (e+f x)+d)\right )}{3 a^2 f (d-c)^3 (\sec (e+f x)+1)^2 (c+d \sec (e+f x))^2} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.09, size = 203, normalized size = 1. \begin{align*}{\frac{1}{2\,f{a}^{2}} \left ( -{\frac{1}{ \left ({c}^{2}-2\,cd+{d}^{2} \right ) \left ( c-d \right ) } \left ({\frac{c}{3} \left ( \tan \left ({\frac{fx}{2}}+{\frac{e}{2}} \right ) \right ) ^{3}}-{\frac{d}{3} \left ( \tan \left ({\frac{fx}{2}}+{\frac{e}{2}} \right ) \right ) ^{3}}-c\tan \left ({\frac{fx}{2}}+{\frac{e}{2}} \right ) +5\,\tan \left ( 1/2\,fx+e/2 \right ) d \right ) }-4\,{\frac{{d}^{2}}{ \left ( c-d \right ) ^{3}} \left ( -{\frac{\tan \left ( 1/2\,fx+e/2 \right ) d}{ \left ( c+d \right ) \left ( \left ( \tan \left ( 1/2\,fx+e/2 \right ) \right ) ^{2}c- \left ( \tan \left ( 1/2\,fx+e/2 \right ) \right ) ^{2}d-c-d \right ) }}-{\frac{3\,c+2\,d}{ \left ( c+d \right ) \sqrt{ \left ( c+d \right ) \left ( c-d \right ) }}{\it Artanh} \left ({\frac{\tan \left ( 1/2\,fx+e/2 \right ) \left ( c-d \right ) }{\sqrt{ \left ( c+d \right ) \left ( c-d \right ) }}} \right ) } \right ) } \right ) } \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] time = 0.645012, size = 2631, normalized size = 12.47 \begin{align*} \text{result too large to display} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F] time = 0., size = 0, normalized size = 0. \begin{align*} \frac{\int \frac{\sec{\left (e + f x \right )}}{c^{2} \sec ^{2}{\left (e + f x \right )} + 2 c^{2} \sec{\left (e + f x \right )} + c^{2} + 2 c d \sec ^{3}{\left (e + f x \right )} + 4 c d \sec ^{2}{\left (e + f x \right )} + 2 c d \sec{\left (e + f x \right )} + d^{2} \sec ^{4}{\left (e + f x \right )} + 2 d^{2} \sec ^{3}{\left (e + f x \right )} + d^{2} \sec ^{2}{\left (e + f x \right )}}\, dx}{a^{2}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] time = 1.25995, size = 662, normalized size = 3.14 \begin{align*} \frac{\frac{12 \, d^{3} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )}{{\left (a^{2} c^{4} - 2 \, a^{2} c^{3} d + 2 \, a^{2} c d^{3} - a^{2} d^{4}\right )}{\left (c \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{2} - d \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{2} - c - d\right )}} + \frac{12 \,{\left (3 \, c d^{2} + 2 \, d^{3}\right )}{\left (\pi \left \lfloor \frac{f x + e}{2 \, \pi } + \frac{1}{2} \right \rfloor \mathrm{sgn}\left (-2 \, c + 2 \, d\right ) + \arctan \left (-\frac{c \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) - d \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )}{\sqrt{-c^{2} + d^{2}}}\right )\right )}}{{\left (a^{2} c^{4} - 2 \, a^{2} c^{3} d + 2 \, a^{2} c d^{3} - a^{2} d^{4}\right )} \sqrt{-c^{2} + d^{2}}} - \frac{a^{4} c^{4} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{3} - 4 \, a^{4} c^{3} d \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{3} + 6 \, a^{4} c^{2} d^{2} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{3} - 4 \, a^{4} c d^{3} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{3} + a^{4} d^{4} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{3} - 3 \, a^{4} c^{4} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) + 24 \, a^{4} c^{3} d \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) - 54 \, a^{4} c^{2} d^{2} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) + 48 \, a^{4} c d^{3} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) - 15 \, a^{4} d^{4} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )}{a^{6} c^{6} - 6 \, a^{6} c^{5} d + 15 \, a^{6} c^{4} d^{2} - 20 \, a^{6} c^{3} d^{3} + 15 \, a^{6} c^{2} d^{4} - 6 \, a^{6} c d^{5} + a^{6} d^{6}}}{6 \, f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]